<!DOCTYPE html>
<html>
<head>
    <style>
        body {
            width: 300px;
            padding: 15px;
            font-family: Arial, sans-serif;
            font-size: 14px;
        }
        .section {
            margin-bottom: 15px;
            padding-bottom: 10px;
            border-bottom: 1px solid #eee;
        }
        .section:last-child {
            border-bottom: none;
        }
        h3 {
            margin: 0 0 10px 0;
            font-size: 16px;
        }
        button {
            padding: 5px 10px;
            margin-right: 5px;
            cursor: pointer;
        }
        .status {
            display: inline-block;
            width: 10px;
            height: 10px;
            border-radius: 50%;
            margin-right: 5px;
        }
        .status.running {
            background-color: #4CAF50;
        }
        .status.stopped {
            background-color: #f44336;
        }
        .status-container {
            margin: 5px 0;
        }
        .interval-control {
            margin: 8px 0;
        }
        input[type="number"] {
            width: 80px;
            padding: 3px;
        }
        .night-mode-section {
            background-color: #f0f0f5;
            padding: 10px;
            border-radius: 5px;
        }
        .time-inputs {
            display: flex;
            gap: 10px;
            margin: 8px 0;
        }
        .checkbox-label {
            display: flex;
            align-items: center;
            margin: 5px 0;
        }
        .checkbox-label input {
            margin-right: 5px;
        }
    </style>
</head>
<body>
    <div class="section">
        <h3>自动接听</h3>
        <div class="status-container">
            <span id="answerStatus" class="status stopped"></span>
            <span id="answerStatusText">未运行</span>
        </div>
        <button id="toggleAnswer">开始自动接听</button>
        <div class="interval-control">
            <label>检查间隔(毫秒):</label>
            <input type="number" id="answerInterval" min="1000" value="4000">
            <button id="updateAnswerInterval">更新</button>
        </div>
    </div>

    <div class="section">
        <h3>自动刷新</h3>
        <div class="status-container">
            <span id="refreshStatus" class="status stopped"></span>
            <span id="refreshStatusText">未运行</span>
            <span>执行次数: <span id="refreshCounter">0</span></span>
        </div>
        <button id="toggleRefresh">开始自动刷新</button>
        <div class="interval-control">
            <label>刷新间隔(毫秒):</label>
            <input type="number" id="refreshInterval" min="10000" value="1800000">
            <button id="updateRefreshInterval">更新</button>
        </div>
    </div>

    <div class="section">
        <h3>网络检测</h3>
        <div class="status-container">
            <span id="networkStatus" class="status stopped"></span>
            <span id="networkStatusText">未运行</span>
        </div>
        <button id="toggleNetwork">开始网络检测</button>
        <div class="interval-control">
            <label>检测间隔(毫秒):</label>
            <input type="number" id="networkInterval" min="1000" value="1000">
            <button id="updateNetworkInterval">更新</button>
        </div>
    </div>

    <div class="section night-mode-section">
        <h3>夜间模式设置</h3>
        <div class="status-container">
            <span id="nightModeStatus" class="status stopped"></span>
            <span id="nightModeStatusText">未激活</span>
        </div>
        <div class="checkbox-label">
            <input type="checkbox" id="enableNightMode" checked>
            <label for="enableNightMode">启用夜间模式</label>
        </div>
        <div class="time-inputs">
            <div>
                <label>开始时间(小时):</label>
                <input type="number" id="nightStartHour" min="0" max="23" value="20">
            </div>
            <div>
                <label>结束时间(小时):</label>
                <input type="number" id="nightEndHour" min="0" max="23" value="6">
            </div>
        </div>
        <p>夜间模式激活时，可按空格键接听来电</p>
        <button id="updateNightModeSettings">保存设置</button>
    </div>

    <script src="popup.js"></script>
</body>
</html>
    